package com.lib.krismile.ui.main;

import android.view.ViewTreeObserver;
import android.widget.Toast;

import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.ViewModelProvider;

import com.chad.library.adapter.base.BaseBinderAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.lib.krismile.BR;
import com.lib.krismile.R;
import com.lib.krismile.base.BaseActivity;
import com.lib.krismile.base.adapter.BaseCommonAdapter;
import com.lib.krismile.base.adapter.BaseCommonMultiAdapter;
import com.lib.krismile.databinding.ActivityMainBinding;
import com.lib.krismile.databinding.LayoutTestItemBinding;
import com.lib.krismile.entity.MainTestItemEntity;
import com.lib.krismile.manager.ARouterCommonHelp;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.function.Consumer;

import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Observer;
import io.reactivex.schedulers.Schedulers;

public class MainActivity extends BaseActivity<ActivityMainBinding, MainViewModel> {

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_main;
    }

    @Override
    protected void initViewModel() {
        //初始化创建当前页面的ViewModel
        mViewModel = new ViewModelProvider(this).get(MainViewModel.class);
    }

    @Override
    protected void bindViewModel() {
        //设置 ViewModel 绑定到 xml中 data标签中
        mDataBinding.setViewModel(mViewModel);

    }

    @Override
    protected void init() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {
        mDataBinding.testMVVMText.setOnClickListener(view ->
                ARouterCommonHelp.navigationSingleWebPage("https://www.baidu.com"));
    }

}